package com.xprophet.crs.jpeg.codec;

import java.io.InputStream;

import com.xprophet.crs.jpeg.codec.model.Fingerprint;

public interface IJPEGDecoder {

	int QTABLE_MAX_IDX = 63;
	
	/**
	 * analysis JPEG:
	 * refer to http://www.drewnoakes.com/drewnoakes.com/code/exif/sampleUsage.html
	 * @param is could be file, remote source, image stream
	 * @return
	 */
	boolean parseImage(InputStream is);
	
	/**
	 * compose one-line string with DQT0 and DQT1 in some order
	 * @return
	 */
	String getData();
	
	/**
	 * Encrypt one-line string with MD5 algorithm
	 * @return
	 */
	String getEncryptedData();
	
	/**
	 * get codec unique ID
	 * @return
	 */
	String getID();
	
	void updateMatchMap(Fingerprint newValue);
	
	/**
	 * check database
	 * @param key
	 * @param lastResult
	 * @return FingerprintType
	 */
	Fingerprint getMatchResult(String key, Fingerprint lastResult);
	
	void setExif(Fingerprint exif);
	
	Fingerprint getExif();
}
